package cn.edu.zjut.medlinebackend.model.dto;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 *  用来和ES中的图片表进行交互
 */
@Document(indexName = "picture")
@Data
public class PictureEsDTO {

    private static final String DATE_TIME_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
    /**
     * id
     */
    @Id
    private Integer id;

    /**
     * 所在文件的id
     */
    private Long fileId;

    /**
     * 内容
     */
    private String content;


    /**
     * 数据是否被删除   0--没有删除   1--已被删除
     */
    private Integer isDelete;

    /**
     * 更新时间
     */
    @Field(index = false, store = true, type = FieldType.Date, format = {}, pattern = DATE_TIME_PATTERN)
    private Date updateTime;

    /**
     * 图片名
     */
    private String imgtitle;
}
